import java.util.Arrays;

public class test {
    public static int[] func(int[]nums,int target){
        int[]ret={-1,-1};
        for (int i = 0; i <nums.length ; i++) {
            for (int j = i+1; j < nums.length; j++) {
                if(nums[i]+nums[j]==target){
                    ret[0]=i;
                    ret[1]=j;
                }
            }
        }
        return ret;
    }
    public static void main(String[] args) {
        int[]nums={1,2,3,4,5,6};
        int target=7;
        int ret[]=func(nums,target);
        System.out.println(Arrays.toString(ret));
    }
}
